﻿@model Orion.Models.HomeIndexViewModel

<script src="@Url.Content("~/Scripts/Pagination/jquery.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/Pagination/jquery.pagination.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/Pagination/jquery.pag.js")" type="text/javascript"></script>
           
@{
    ViewBag.Title = "IRIS - Atburðir";
}


<script src="@Url.Content("~/Scripts/event.js")" type="text/javascript"></script>

<section id="main_content">
    <h1>Væntanlegir Atburðir</h1>


    <div id="eventIndexCalender">
		<div style="float: right;" id="datepicker"></div>
    </div>

    <div id="Searchresult"></div>

    @{
        var sk = 0;
        for( int m = 0; m < Model.counter; m++ )
        {
        <div id="hiddenresult" style="display:none;">
            <div class="result">
                <table id="events" cellspacing="0">
                    <tbody>
                    <tr>
                    <th>Dagsetning</th>
                    <th>Nafn Atburðar</th>
                    <th>Staðsetning</th>
                    <th>Tengill</th>
                    </tr>
                    @foreach (var e in Model.Events.Skip(sk).Take( Model.displayNewsArticle ) )
                    {
                        DateTime temp = e.EventDate;
                        <tr>
                        <td>
                            @Html.ActionLink(@temp.ToString("dd MMMM yyyy"), "EventById/" + @e.ID, "Event")
                        </td>
                        <td>
                            @Html.ActionLink(@e.Title, "EventById/" + @e.ID, "Event")
                        </td>
                        <td>@Html.ActionLink(e.Title, "EventById/" + @e.ID, "Event")</td>
                        <td>@Html.ActionLink("Nánar >>", "EventById/" + @e.ID, "Event")</td> 
                        </tr>
                    }
                    </tbody>
                </table>
            </div>
        </div>
        sk = sk + Model.displayNewsArticle;
        }
    }   <div id="Pagination"></div>
</section>
    